# 封装接口对象层,定义一个类,继承object,
# 封装接口不用调用函数,就是直接把普通方法的内容写进来,动态的写进参数,
# 静态的写进方法里面,返回值return
import requests
class IhrmApi(object):
    @classmethod
    def login(cls,json_data):
        url = "http://ihrm-test.itheima.net/api/sys/login"
        header = {"Content-Type": "application/json"}
        resp = requests.post(url=url, headers=header, json=json_data)
        return resp
# 在当前页面测试一下,给形参赋值一个实参,然后打印结果
if __name__ == '__main__':
    json_data = {"mobile": "13800000002", "password": "123456"}
    resp = IhrmApi.login(json_data)
    print(resp.json())


